package com.doit.day03

//类  Tuple
object _06_元祖 {
  def main(args: Array[String]): Unit = {
    val tuple: (Int, Int, Int, Int) = new Tuple4[Int, Int, Int, Int](1, 2, 3, 4)
    println(tuple._1)
    println(tuple)

    //定义元祖的第二种方式
    val tp :(Int,String,Boolean,Char,Double)= (1,"zss",true,'c',1.0)

    //可以用来代替一个对象
    val tuple1: (Int, String, Int, String) = (1, "zss", 18, "male")

    //二元元祖==》对偶元祖  ==》 map()
    val tuple2: (Int, String) = (1, "zss")

    val map: Map[Int, String] = Map((1, "zss"), (2, "lss"), (3, "ww"), (4, "zl"))
    for (elem <- map) {
      val key: Int = elem._1
      val value: String = elem._2
    }


//    Map(1 -> "zss",2 -> "lss")







  }
}
